var msg
function yzm() {
    $.ajax({
        type: 'get',
        url: 'http://47.94.4.201/index.php/index/index/getcode',
        data: {},
        dataType: 'json',
        success: (data) => {
            msg = data.msg
            alert(msg)
        },
        error: (e) => {
            console.log(e);
        }
    })
}

function fn() {
    var userid = $('input:eq(0)').val()
    $.ajax({
        type: 'post',
        url: 'http://47.94.4.201/index.php/index/index/login',
        data: {
            name: $('input:eq(0)').val(),
            pwd: $('input:eq(1)').val(),
            vercode: $('input:eq(2)').val()
        },
        dataType: 'json',
        success: (data) => {
            console.log(data);
            localStorage.setItem('name', JSON.stringify(userid))
            location.assign('./主页.html')
        },
        error: (e) => {
            console.log(e);
        }
    })
}